package vip.liux.front.infrastructure.jpa.identity;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import vip.liux.contracts.models.identity.IdentityRole;
import vip.liux.contracts.repositories.identity.IdentityRoleRepository;

import java.util.Optional;

public interface IdentityRoleJpaRepository extends JpaRepository<IdentityRole, Long>, IdentityRoleRepository {

    @Query("select r from IdentityRole r where r.name = :name or r.normalizedName = :name")
    @Override
    Optional<IdentityRole> findByNameOrNormalizedName(String name);
}
